// @for $var from <开始值> through <结束值>{}
// @for $var from <开始值> to <结束值>{} //to不包含最后一位值
//停止位置不一样
$colums:12;
@for $i from 1 through $colums {
    .list-item#{$i} {
        width: 100%/$colums*$i
    }
}

$icons:success error warning;
@each $icon in $icons {
    .icon-#{$icon} {
        background:url(img/#{$icon}.png});
    }
}

$types: 4;
$type-width: 20px;
@while $types>0 {
    .while-#{$types} {
        width: $type-width + $types;
    }
    $types: $types - 1;
}
//自定义函数
// @function 函数名(){

// }
$test-color:(light:#fff,dark:#000);
@function color($key){
    @return map-get($test-color,$key)
}
span{
    background: color(dark);
}
